package com.akl.ssmspringboot.quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 实现业务逻辑execute方法
 * @author guoxy
 * @date 2019/1/9 11:13
 * @description
 */
public class HelloQuartz implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        //打印当前执行的时间
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("当前时间是："+sdf.format(date));
        //业务逻辑
        System.out.println("业务逻辑:Hellow World");
    }
}
